package com.hspedu.extend_;

public class ExtendsTheory {
	public static void main(String args[])
	{
		Son son = new Son();
		System.out.println(son.age);
		System.out.println(son.name);
		System.out.println(son.hobby);
	}
}

class GrandPa
{
	String name = "爷爷";
	String hobby = "旅游";
}

class Father extends GrandPa
{
	String name = "爸爸";
	int age = 39;
}

class Son extends Father
{
	String name = "儿子";
}
